const fs = require('fs')
const xlsx = require('node-xlsx')

function writeXls(data){
    return xlsx.build([{
        name:'sheet1',
        data
    }])
}

function createXls(buffer,name){
    fs.writeFileSync(`${__dirname}${name}.xlsx`,buffer,{'flag':'w'})   //生成excel
}

module.exports = {
    writeXls,
    createXls
}